package com.ywk.pattern._14_observer._14_3;


import java.util.ArrayList;
import java.util.List;

public class Secretary {
    //同事列表
    private List<Observer> observerList = new ArrayList<>();
    private String action;

    //增加
    public void Attach(Observer observer) {

        observerList.add(observer);
    }

    //减少
    public void Detach(Observer observer) {
        observerList.remove(observer);
    }

    //通知
    public void Notify() {
        for (Observer stockObserver : observerList) {
            stockObserver.Update();
        }
    }
    //前台状态


    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }
}
